package com.ruoyi.common.websocket;

import com.ruoyi.common.core.domain.AjaxResult;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * websocket消息类型
 */
@Data
@Accessors(chain = true)
public class WebSocketMessage {

    private MsgType msgType;

    private AjaxResult result;

    public WebSocketMessage() {
    }

    public WebSocketMessage(MsgType msgType, AjaxResult result) {
        this.msgType = msgType;
        this.result = result;
    }

    public static WebSocketMessage build(){
        return new WebSocketMessage();
    }

    public static WebSocketMessage build(MsgType msgType, AjaxResult result) {
        return new WebSocketMessage(msgType, result);
    }
}
